package com.like.widget;

import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.like.hospitalworld.R;

public class MyToast {

    public static void showBlueCircleToast(Context context, String content) {
        LayoutInflater inflater = LayoutInflater.from(context);

        View layout = inflater.inflate(R.layout.toast_blue_circle, null);

        RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
        TextView text = (TextView) layout.findViewById(R.id.content);
        text.setText(content);
        layout.setLayoutParams(params);

        Toast toast = new Toast(context.getApplicationContext());
        toast.setGravity(Gravity.CENTER, 0, 0);
        toast.setDuration(Toast.LENGTH_SHORT);
        toast.setView(layout);
        toast.show();
    }

}
